package info.aquaball.data;

public class MannschaftImpl implements Mannschaft {

	private String id;
	private String name;
	private String altersklasseId;

	public MannschaftImpl() {
		id = null;
		name = "";
		altersklasseId = null;
	}

	public MannschaftImpl(String name, String altersklasseId) {
		super();
		this.id = null;
		this.name = name;
		this.altersklasseId = altersklasseId;
	}

	public MannschaftImpl(String id, String name, String altersklasseId) {
		super();
		this.id = id;
		this.name = name;
		this.altersklasseId = altersklasseId;
	}

	@Override
	public String getId() {
		return id;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public String getAltersklasseId() {
		return altersklasseId;
	}

	@Override
	public void setId(String id) {
		this.id = id;
	}

	@Override
	public void setAltersklasseId(String alterklasseId) {
		this.altersklasseId = alterklasseId;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((altersklasseId == null) ? 0 : altersklasseId.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		MannschaftImpl other = (MannschaftImpl) obj;
		if (altersklasseId == null) {
			if (other.altersklasseId != null)
				return false;
		} else if (!altersklasseId.equals(other.altersklasseId))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

	@Override
	public String toString() {
		String output = "Mannschaft Object " + id +"\n" + 
						"Name: " + name + "\n" +
						"AltersklasseId: " + altersklasseId + "\n";
		return output;
	}

}
